#include "StdAfx.h"
#include "Product.h"
#include <iostream>

using namespace std;
//void constructor print message.
Product::Product(void)
{
	cout<<"void constructor for object "<<this<<" was created\n"<<endl;
}

//constructor with para-s set values and print message.
Product::Product(char* name,char* id,int count){
	cout<<"constructor for object "<<this<<" with param-s was created\n"<<endl;
	this->name = name;
	this->id = id;
	this->count = count;
}

//copy constructor prints message and copy values from input object.
Product::Product(const Product &product)
{
	cout<<"copy constructor for object "<<this<<" was created"<<endl;
	name = product.name;
	id = product.id;
	count = product.count; 
}

//destructor prints message.
Product::~Product(void)
{
	cout<<"the "<<this<<" was destroy\n";
}
/*
getters ant setters.
*/
void Product::setName(char* name){
	this->name = name;
}

char* Product::getName(){
	return name;
}

void Product::setId(char* id){
	this->id = id;
}

char* Product::getId(){
	return id;
}

void Product::setCount(int count){
	this->count = count;
}

int Product::getCount(){
	return count;
}

//prints values.
void Product::showMessage(){
	cout << "name = "<< name <<"\nid = "<<id<<"\ncount = "<<count<<"\n"<<endl;
}